#include <stdio.h>
#include <stdlib.h>
#include "GestionMemoire.c"

int main(int argc, char ** argv) {
	
	char * buffer1 = NULL;
	char * buffer2 = NULL;
	char * buffer3 = NULL;
	char * buffer4 = NULL;

	/* Test 01 */
	Initialize();
	PrintListOfFreeBlocks();

	/* Test 02 */
	buffer1 = gMalloc(30);
	PrintListOfFreeBlocks();

	/* Test 03 */
	buffer2 = gMalloc(300);
	PrintListOfFreeBlocks();

	/* Test 04 */ 
	buffer2 = gMalloc(194);
	PrintListOfFreeBlocks();

	gFree(buffer1);
	gFree(buffer2);

	PrintListOfFreeBlocks();

	buffer1 = gMalloc(30);
	buffer2 = gMalloc(30);
	buffer3 = gMalloc(30);
	
	/* Test 05 */
	gFree(buffer1);
	PrintListOfFreeBlocks();

	/* Test 06 */
	gFree(buffer3);
	PrintListOfFreeBlocks();

	/* Test 07 */
	gFree(buffer2);
	PrintListOfFreeBlocks();

	/* Test 08 */
	gFree(buffer4);

	/* Test 09 */
	buffer1 = gMalloc(30);
	buffer1 = buffer1 - 100;
	gFree(buffer1);

}


	
